package com.rightrule.rule.dto;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.rightrule.rule.constans.FieldSourceEnum;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

@Data
@ToString
public class FieldComputeTask implements Serializable {

    private String taskTag;

    private Long interfaceId;

    private String interfaceName;

    private String interfaceMethodName;

    private String interfaceVersion;

    private Integer costTime; // 接口方法的超时时间

    private String reqParams;

    private String dbSource;

    private String logicType;

    /**
     * 拉取任务来源，可以理解为变量类型
     */
    private FieldSourceEnum source;

    /**
     * 请求变量列表，值是变量名：fieldName;
     */
    private List<String> requestFieldList = Lists.newArrayList();

    /**
     * 记录请求变量的数据类型
     */
    private Map<String, Integer> fieldDataTypeMap = Maps.newHashMap();

    /**
     * 记录请求变量异常情况下的默认值
     */
    private Map<String, Object> exceptDataValueMap = Maps.newHashMap();

    /**
     * 记录从各个变量结果对应的key
     */
    private Map<String, String> valueKeyMap = Maps.newHashMap();

    /**
     * 记录请求变量的校验类型
     */
    private Map<String, Integer> fieldValidateTypeMap = Maps.newHashMap();

    /**
     * 记录请求变量的校验类型的脚本
     */
    private Map<String, String> fieldValidateScriptMap = Maps.newHashMap();

    /**
     *  todo 变量计算追踪器
     */
//    private Map<String, FieldTracer> tracerMas = Maps.newHashMap();

    /**
     * 透传参数
     */
    private Map<String, Object> sessionData = Maps.newHashMap();


    private String ipId;

    private String businessId;


    private Object groovyClass;
}
